<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2025/7/4
  Time: 9:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div class="content">
    <h1 class="section-title"><i class="fas fa-list"></i> 订单管理</h1>

    <div class="data-section">
        <table class="order-table">
            <thead>
            <tr>
                <th>订单ID</th>
                <th>请求用户</th>
                <th>提供用户</th>
                <th>服务类型</th>
                <th>开始日期</th>
                <th>结束日期</th>
                <th>价格</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${orders}" var="order">
                <tr>
                    <td>${order.order_id}</td>
                    <td>${order.requester_id}</td>
                    <td>${order.provider_id}</td>
                    <td>${order.service_type}</td>
                    <td>${order.start_date}</td>
                    <td>${order.end_date}</td>
                    <td>¥${order.price}</td>
                    <td>
                            <span class="status-badge status-${order.status.toLowerCase()}">
                                <c:choose>
                                    <c:when test="${order.status == 'PENDING'}">待确认</c:when>
                                    <c:when test="${order.status == 'CONFIRMED'}">已确认</c:when>
                                    <c:when test="${order.status == 'CANCELLED'}">已取消</c:when>
                                    <c:when test="${order.status == 'COMPLETED'}">已完成</c:when>
                                    <c:otherwise>${order.status}</c:otherwise>
                                </c:choose>
                            </span>
                    </td>

                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
</div>

</body>
</html>
